package com.netease.nie.controllers;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.netease.nie.base.controllers.BaseController;
import com.netease.nie.dto.CategoryDto;
import com.netease.nie.facade.CategoryFacade;

/**
 * 
 * @author KingsHunter
 * @createDate February 8th,2017
 *
 */
@RestController
@RequestMapping("/api/category")
public class CategoryController extends BaseController {

	@Autowired
	private CategoryFacade goodsCategoryFacade;
	
	@RequestMapping(value = "/list", method = RequestMethod.GET, produces = "application/json")
	public String list() throws Exception {
		List<CategoryDto> categoryDtos = goodsCategoryFacade.listAllCategoryDtos();
		return jsonSuccess(categoryDtos);
	}
	
}